]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Move HotCorner to chrome instead of in the panel
authorAlexander Larsson <alexl@redhat.com>
Wed, 23 Feb 2011 13:35:45 +0000 (14:35 +0100)
committerAlexander Larsson <alexl@redhat.com>
Wed, 23 Feb 2011 19:16:48 +0000 (20:16 +0100)
This prepares for there being multiple hot corners, one per monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=642881

js/ui/main.js
js/ui/panel.js

index ec8a68e52a6350e08aa880ee73a6c23522180991..f0b7e26ebe65af7d518d8ef87711c7e6bbb01b25 100644 (file)
@@ -48,6 +48,7 @@ DEFAULT_BACKGROUND_COLOR.from_pixel(0x2266bbff);
 
 let chrome = null;
 let panel = null;
+let hotCorner = null;
 let placesManager = null;
 let overview = null;
 let runDialog = null;
@@ -140,6 +141,7 @@ function start() {
     magnifier = new Magnifier.Magnifier();
     statusIconDispatcher = new StatusIconDispatcher.StatusIconDispatcher();
     panel = new Panel.Panel();
+    hotCorner = new Panel.HotCorner();
     wm = new WindowManager.WindowManager();
     messageTray = new MessageTray.MessageTray();
     notificationDaemon = new NotificationDaemon.NotificationDaemon();
@@ -389,6 +391,11 @@ function _getAndClearErrorStack() {
 
 function _relayout() {
     let primary = global.get_primary_monitor();
+    if (St.Widget.get_default_direction() == St.TextDirection.RTL)
+        hotCorner.actor.set_position(primary.x + primary.width, primary.y);
+    else
+        hotCorner.actor.set_position(primary.x, primary.y);
+    panel.setHotCorner(hotCorner);
     panel.actor.set_position(primary.x, primary.y);
     panel.actor.set_size(primary.width, Panel.PANEL_HEIGHT);
     overview.relayout();
index 9efe5516ace80631b906272bac83be28ecc7a436..136eb93468d003b8e300eb5760b14d813ffd653e 100644 (file)
@@ -706,6 +706,8 @@ HotCorner.prototype = {
                     }
                  }
             });
+
+        Main.chrome.addActor(this.actor, { visibleInOverview: true, affectsStruts: false });
     },
 
     destroy: function() {
@@ -865,16 +867,6 @@ Panel.prototype = {
 
             let childBox = new Clutter.ActorBox();
 
-            childBox.y1 = 0;
-            childBox.y2 = this._hotCorner.actor.height;
-            if (this.actor.get_direction() == St.TextDirection.RTL) {
-                childBox.x1 = allocWidth;
-            } else {
-                childBox.x1 = 0;
-            }
-            childBox.x2 = childBox.x1 + this._hotCorner.actor.width;
-            this._hotCorner.actor.allocate(childBox, flags);
-
             childBox.y1 = 0;
             childBox.y2 = allocHeight;
             if (this.actor.get_direction() == St.TextDirection.RTL) {
@@ -941,8 +933,7 @@ Panel.prototype = {
                 corner.actor.set_style_pseudo_class(pseudoClass);
             }));
 
-        this._hotCorner = new HotCorner();
-        this._boxContainer.add_actor(this._hotCorner.actor);
+        this._hotCorner = null;
 
         let appMenuButton = new AppMenuButton();
         this._leftBox.add(appMenuButton.actor);
@@ -1032,6 +1023,14 @@ Panel.prototype = {
         this.button._xdndTimeOut = 0;
     },
 
+
+    // While there can be multiple hotcorners (one per monitor), the hot corner
+    // that is on top of the Activities button is special since it needs special
+    // coordination with clicking on that button
+    setHotCorner: function(corner) {
+        this._hotCorner = corner;
+    },
+
     startStatusArea: function() {
         for (let i = 0; i < STANDARD_TRAY_ICON_ORDER.length; i++) {
             let role = STANDARD_TRAY_ICON_ORDER[i];